<!--
 * @Author: your name
 * @Date: 2021-09-14 17:44:06
 * @LastEditTime: 2021-09-14 18:04:15
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \uniappPRO\hello-uni\components\components\Yingshou.vue
-->
<template>
	<view class="jianbao">
		<!-- 应收 -->
		<Title :title="title" :text="text"/>	
		<!-- 客户数据 -->
		<card :cards="cards"/>
		<!-- 查看详情 -->
		<Detail :url="url"/>
	</view>
</template>

<script>
	import Title from './common/Title.vue';
	import Card from './common/Card.vue';
	import Detail from './common/Detail.vue';
	import { ref , reactive } from "vue"
	export default {
		components: {
			Title,Card,Detail
		},
		setup(){
			const title = ref("加载中...")
			const text = ref("(权限内/2021年9月)")
			const cards = reactive([])
			const url = ref('/pages/index/Commonlist/Kehulist/Kehulist')
			uni.request({
				//仅为示例，并非真实接口地址。
				url: 'http://nboa.jzsoft.cn:777/pro/api/workbench/deskmode?modetype=jianbao', 
				method: 'POST',
				data:{
					'entno':'jzcs',
					'loginname':'admin',
					'loginpass':'admin'
				},
				success: res => {
					console.log(res.data.result);
					// console.log(res.data.result.title);
					title.value = res.data.result.title  // 标题赋值
					const cardsdata = res.data.result.data // 卡片数据
					 cardsdata.forEach(e => {  //  卡片数据赋值
					    cards.push(e);
					  });
					
				}
			});
			
			return{
				title,
				text,
				cards,
				url
			}
		}
		}
</script>

<style scoped lang="scss">

	
	
	
</style>
